#include "stdafx.h"
#include <Inklude/ikCThread.h>


using namespace Inklude;


int main(int argc, char** argv)
{
    ikCThread threadA;
    ikCThread threadB;

    bool bIsRunning = true;

    BEGIN_IK_THREAD_CODE_VALUE_CAPTURE(routine_A)
        while(bIsRunning)
        {
            printf("A\n");
            Sleep(100);
        }
    END_IK_THREAD_CODE

    threadA.RegisterCodeFragement(routine_A);

    BEGIN_IK_THREAD_CODE_VALUE_CAPTURE(routine_B)
        while(bIsRunning)
        {
            printf("BBBBBBBBBBBBBB\n");
            Sleep(100);
        }
    END_IK_THREAD_CODE

    threadB.RegisterCodeFragement(routine_B);

    threadA.Start();
    threadB.Start();

    Sleep(5000);

    bIsRunning = false;

    printf("thread test end\n");
}

